<template>
  <div>
    <el-container class="outer-container">
      <el-header>
        <el-row :gutter="24">
          <el-col :span="6">
            <div style="border: 3px solid revert">{{ user }}</div>
          </el-col>
          <el-col :span="12">
            <div style="text-align: center;">Header</div>
          </el-col>
          <el-col :span="6">
            <div>right</div>
          </el-col>
        </el-row>
      </el-header>
      <el-container>
        <el-aside :style="{width:'200px'}">
          <ey-menu></ey-menu>
        </el-aside>
        <el-container>
          <el-main>
            <ey-tabs></ey-tabs>
          </el-main>
          <el-footer>eyeo zhihao_meng@163.com &copy; 版权所有</el-footer>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import eymenu from './eyMenu.vue'
import eyTabs from './eyTabs.vue'
import cookie from '../../util/cookie'
export default {
  name: 'layout',
  data () {
    return {
      user: localStorage.getItem('eyeo_user')
    }
  },
  components: {
    'ey-menu': eymenu,
    'ey-tabs': eyTabs
  },
  mounted: function () {
    if (!cookie.get('yihong.Authorization')) {
      this.$router.push({path: '/', query: {msg: '请先登录'}})
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.el-header,
.el-footer {
  background: linear-gradient(90deg, turquoise,darkturquoise,cyan);
  color: #FFFFFF;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background: linear-gradient(90deg, #ABCDEF,#BCEFF0,#ABCDEF);
  color: #FFFFFF;
  text-align: center;
  line-height: 200px;
}

.el-main {
  padding: 5px;
  background-color: azure;
}

.outer-container {
  height: 100vh;
}

</style>
